package com.jinduplan.planmanager.mvp.contract

import com.cxz.kotlin.baselibs.mvp.IModel
import com.cxz.kotlin.baselibs.mvp.IPresenter
import com.cxz.kotlin.baselibs.mvp.IView
import com.jinduplan.planmanager.bean.*
import io.reactivex.rxjava3.core.Observable
import okhttp3.RequestBody

/**
 * @author admin
 * @date 2018/11/20
 * @desc
 */
interface LoginRegisterContract {

    interface View : IView {

        fun getCodeSuccess()
        fun getCodeFail()
        fun loginSuccess(data: LoginInfo)
        fun changePswSuccess(data: LoginInfo)

        fun registerSuccess(data: LoginInfo)

        fun getSms(code:String)

    }

    interface Presenter : IPresenter<View> {

        fun register(username: String, password: String, code: String)
        fun changePsw(username: String, password: String, code: String)

        fun login(username: String, password: String)

        fun smsSend(phone: RequestBody)

        fun loginWithSms(username: String, sms: String)
    }

    interface Model : IModel {

        fun login(username: String, password: String): Observable<HttpResult<LoginInfo>>
        fun loginWithSms(username: String, sms: String): Observable<HttpResult<LoginInfo>>
        fun register(username: String, password: String, code: String): Observable<HttpResult<LoginInfo>>
        fun changePsw(username: String, password: String, code: String): Observable<HttpResult<LoginInfo>>
        fun smsSend(phone: RequestBody): Observable<HttpResult<Any>>

    }

}